#include "StdAfx.h"
#include "MatrixBuilder.h"

CMatrixBuilder::CMatrixBuilder(CPoint p)
{
	this->p.x = p.x;
	this->p.y = p.y;
}

CMatrixBuilder::CMatrixBuilder(void)
{
}


CMatrixBuilder::~CMatrixBuilder(void)
{
}

CMatrixBuilder* CMatrixBuilder::add(CPoint p)
{
	this->p = CMatrix(this->p).add(p);
	return this;
}
CMatrixBuilder* CMatrixBuilder::minus(CPoint p)
{
	this->p = CMatrix(this->p).minus(p);
	return this;
}
CMatrixBuilder* CMatrixBuilder::mul(CPoint p)
{
	this->p = CMatrix(this->p).mul(p);
	return this;
}
CMatrixBuilder* CMatrixBuilder::mul(double scale)
{
	this->p = CMatrix(this->p).mul(p);
	return this;
}
CMatrixBuilder* CMatrixBuilder::mul(CMatrixBuilder* matrix)
{
	this->p = CMatrix(this->p).mul(matrix->toResult());
	return this;
}
CPoint CMatrixBuilder::toResult()
{
	return this->p;
}